﻿<!doctype html>
<html class="no-js" lang="zxx">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Addina - 网上图书商城</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/x-icon" href="../../imgs/favicon.png">
    <link rel="stylesheet" href="../../css/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/meanmenu.min.css">
    <link rel="stylesheet" href="../../css/animate.css">
    <link rel="stylesheet" href="../../css/swiper.min.css">
    <link rel="stylesheet" href="../../css/slick.css">
    <link rel="stylesheet" href="../../css/magnific-popup.css">
    <link rel="stylesheet" href="../../css/fontawesome-pro.css">
    <link rel="stylesheet" href="../../css/spacing.css">
    <link rel="stylesheet" href="../../css/main.css">
</head>
<body>
<script src="../../../console-ban.min.js"></script>
<div id="preloader">
    <div class="bd-loader-inner">
        <div class="bd-loader"><span class="bd-loader-item"></span><span class="bd-loader-item"></span><span
                class="bd-loader-item"></span><span class="bd-loader-item"></span><span
                class="bd-loader-item"></span><span class="bd-loader-item"></span><span
                class="bd-loader-item"></span><span class="bd-loader-item"></span></div>
    </div>
</div>
<div class="backtotop-wrap cursor-pointer">
    <svg class="backtotop-circle svg-content" width="100%" height="100%" viewbox="-1 -1 102 102">
        <path d="M50,1 a49,49 0 0,1 0,98 a49,49 0 0,1 0,-98"></path>
    </svg>
</div>
<div class="df-search-area">
    <div class="container">
        <div class="row">
            <div class="col-xl-12">
                <div class="df-search-form">
                    <div class="df-search-close text-center mb-20">
                        <button class="df-search-close-btn df-search-close-btn"></button>
                    </div>
                    <form action="#">
                        <div class="df-search-input mb-10"><input type="text" placeholder="Search for product...">
                            <button type="submit"><i class="flaticon-search-1"></i></button>
                        </div>
                        <div class="df-search-category"><span>Search by:</span><a href="#">Healthline,</a><a href="#">COVID-19,</a><a
                                href="#">Surgery,</a><a href="#">Surgeon,</a><a href="#">Medical research</a></div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="body-overlay"></div>
<header>
    <div class="header">
        <div class="header-top-area grocery__top-header">
            <div class="header-layout-4">
                <div class="header-to-main d-none d-sm-flex">
                    <div class="link-text"><span><img src="../../imgs/icons/call.png" alt=""></span><a
                            href="">4001066666-5</a></div>
                    <div class="header-top-notice d-none d-lg-block">
                        <p>热烈庆祝新店开业！为答谢广大顾客的支持与厚爱，特推出限时折扣活动，优惠多多，不容错过！</p>
                    </div>
                    <div class="tp-header-top-menu d-flex align-items-center justify-content-end">
                        <div class="header-lang-item tp-header-setting">
                            <ul>
                                <li><a class="furniture-clr-hover" href="/url/info">个人信息</a></li>
                                <li><a class="furniture-clr-hover" href="/url/cart">购物车</a></li>
                                <li><a class="furniture-clr-hover" href="/url/login">退出登录</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="header-layout-4 header-bottom">
            <div id="header-sticky" class="header-4">
                <div class="mega-menu-wrapper">
                    <div class="header-main-4">
                        <div class="header-left">
                            <div class="header-logo"><a href="/url/index"><img src="../../imgs/furniture/logo/logo.svg"
                                                                               alt="logo not found"></a></div>
                            <div class="mean__menu-wrapper furniture__menu d-none d-lg-block">
                                <div class="main-menu">
                                    <nav id="mobile-menu">
                                        <ul>
                                            <li><a href="/url/index">主页</a></li>
                                            <li class="has-dropdown"><a href="/url/prolist">图书选购</a>
                                                <ul class="submenu">
                                                    <li><a href="/url/prolist">图书选购</a></li>
                                                    <li><a href="/url/cart">购物车</a></li>
                                                </ul>
                                            </li>
                                            <li class="has-dropdown"><a href="/url/prolist">图书分类</a>
                                                <ul class="submenu">
                                                    <li><a href="/url/prolist">教育</a></li>
                                                    <li><a href="/url/prolist">小说</a></li>
                                                    <li><a href="/url/prolist">文艺</a></li>
                                                    <li><a href="/url/prolist">动漫</a></li>
                                                    <li><a href="/url/prolist">童书</a></li>
                                                    <li><a href="/url/prolist">人文社科</a></li>
                                                    <li><a href="/url/prolist">经管</a></li>
                                                    <li><a href="/url/prolist">成功/励志</a></li>
                                                    <li><a href="/url/prolist">生活</a></li>
                                                    <li><a href="/url/prolist">科技</a></li>
                                                    <li><a href="/url/prolist">进口原版</a></li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </nav>
                                </div>
                            </div>
                        </div>
                        <div class="header-right d-inline-flex align-items-center justify-content-end">
                            <div class="header-search d-none d-xxl-block">
                                <form id="form" action="" onsubmit="return false;"><input type="text" placeholder="搜索图书..." v-model="keyword" @change="listProduct()">
                                    <button type="submit">
                                        <svg width="18" height="18" viewbox="0 0 18 18" fill="none"
                                             xmlns="http://www.w3.org/2000/svg">
                                            <path d="M13.4443 13.4445L16.9999 17" stroke="white" stroke-width="2"
                                                  stroke-linecap="round" stroke-linejoin="round"></path>
                                            <path d="M15.2222 8.11111C15.2222 12.0385 12.0385 15.2222 8.11111 15.2222C4.18375 15.2222 1 12.0385 1 8.11111C1 4.18375 4.18375 1 8.11111 1C12.0385 1 15.2222 4.18375 15.2222 8.11111Z"
                                                  stroke="white" stroke-width="2"></path>
                                        </svg>
                                    </button>
                                </form>
                            </div>
                            <div class="header-action d-flex align-items-center ml-30">
                                <div class="header-action-item"><a href="/url/cart"
                                                                   class="header-action-btn cartmini-open-btn">
                                    <svg width="21" height="23" viewbox="0 0 21 23" fill="none"
                                         xmlns="http://www.w3.org/2000/svg">
                                        <path d="M14.0625 10.6C14.0625 12.5883 12.4676 14.2 10.5 14.2C8.53243 14.2 6.9375 12.5883 6.9375 10.6M1 5.8H20M1 5.8V13C1 20.6402 2.33946 22 10.5 22C18.6605 22 20 20.6402 20 13V5.8M1 5.8L2.71856 2.32668C3.12087 1.5136 3.94324 1 4.84283 1H16.1571C17.0568 1 17.8791 1.5136 18.2814 2.32668L20 5.8"
                                              stroke="black" stroke-width="2" stroke-linecap="round"
                                              stroke-linejoin="round"></path>
                                    </svg>
                                    <!--                                    <span class="header-action-badge bg-furniture">12</span>-->
                                </a></div>
                            </div>
                            <div class="header-humbager ml-30" id="header-setting-toggle">
                                <a class="sidebar__toggle">
                                    <div class="bar-icon-2"><span></span><span></span><span></span></div>
                                </a>
                                <div class="header__hamburger ml-50 d-none">
                                    <button type="button" class="hamburger-btn offcanvas-open-btn"><span>01</span><span>01</span><span>01</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>
<main>
    <div class="breadcrumb__area theme-bg-1 p-relative z-index-11 pt-95 pb-95">
        <div class="breadcrumb__thumb" data-background="../../imgs/bg/breadcrumb-bg.jpg"></div>
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-xxl-12">
                    <div class="breadcrumb__wrapper text-center"><h2 class="breadcrumb__title">个人信息</h2>
                        <div class="breadcrumb__menu">
                            <nav>
                                <ul>
                                    <li><span><a href="index.html">主页</a></span></li>
                                    <li><span>个人信息</span></li>
                                </ul>
                            </nav>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="cart-area section-space">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <button type="button" class="btn submit border mr-10" style="margin-bottom:20px;font-size: 20px; padding: 10px 30px;background-color: #b18b5e;color: white"
                            v-on:click="changeShowStatus(1)">个人信息
                    </button>
                    <button type="button" class="btn submit border" style="margin-bottom:20px;font-size: 20px; padding: 10px 30px;background-color: #b18b5e;color: white"
                            v-on:click="changeShowStatus(0)">订单管理
                    </button>
                    <div v-if="showStatus==0" class="table-content table-responsive">
                        <table class="table">
                            <thead>
                            <tr>
                                <th class="product-thumbnail">订单</th>
                                <th class="product-price">下单时间</th>
                                <th class="product-quantity">状态</th>
                                <th class="product-subtotal">金额合计</th>
                                <th class="product-remove">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr v-for="(item,index) in orderList">
                                <td class="product-price" v-text="'#'+(index+1)">#1357</td>
                                <td class="product-price" v-text="item.fmtCreatetime">2020-03-12 12:21:31</td>
                                <td class="product-price" v-text="item.fmtStatus">待发货</td>
                                <td class="product-price" v-text="'￥'+item.payment">￥125.00</td>
                                <td class="product-remove">
                                    <a :href="'/url/orderdetail/'+item.orderid" class="btn-small d-block">查看订单</a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div v-if="showStatus==1">
                        <div class="form-group col-md-6">
                            <label>昵称 <span class="required">*</span></label>
                            <input required="" class="form-control square" name="name"
                                   id="realname" type="text" v-model="user.realname" :value="user.realname">
                        </div>
                        <div class="form-group col-md-12">
                            <label>手机号码 <span class="required">*</span></label>
                            <input required="" class="form-control square" name="text"
                                   id="phone" type="text" v-model="user.phone" :value="user.phone">
                        </div>
                        <div class="form-group col-md-6">
                            <label>地址 <span class="required">*</span></label>
                            <input required="" class="form-control square" name="name"
                                   id="useraddress" type="text" v-model="user.address" :value="user.address">
                        </div>
                        <div class="col-md-12">
                            <button type="button" class="btn submit border mr-10" style="margin-top:20px;font-size: 20px; padding: 10px 30px;background-color: #b18b5e;color: white"
                                    v-on:click="updateInfo()">保存
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</main>
<footer class="footer-bg">
    <div class="footer-area pt-100 pb-20">
        <div class="footer-style-4">
            <div class="container">
                <div class="footer-grid-3">
                    <div class="footer-widget-4">
                        <div class="footer-logo mb-35"><a href="/url/index"><img
                                src="../../imgs/furniture/logo/logo-light.svg" alt="image bnot found"></a></div>
                        <p>汇聚万千好书，点亮智慧之光，我们的书店网站，您的阅读天堂！</p>
                        <div class="theme-social"><a class="furniture-bg-hover" href="#"><i
                                class="fa-brands fa-facebook-f"></i></a><a class="furniture-bg-hover" href="#"><i
                                class="fa-brands fa-twitter"></i></a><a class="furniture-bg-hover" href="#"><i
                                class="fa-brands fa-linkedin-in"></i></a><a class="furniture-bg-hover" href="#"><i
                                class="fa-brands fa-instagram"></i></a></div>
                    </div>
                    <div class="footer-widget-4">
                        <div class="footer-widget-title"><h4>服务</h4></div>
                        <div class="footer-link">
                            <ul>
                                <li><a href="/url/register">注册</a></li>
                                <li><a href="/url/login">登录</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="footer-widget-4">
                        <div class="footer-widget-title"><h4>商城</h4></div>
                        <div class="footer-link">
                            <ul>
                                <li><a href="/url/prolist">图书选购</a></li>
                                <li><a href="/url/cart">购物车</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="footer-widget footer-col-4">
                        <div class="footer-widget-title"><h4>联系方式</h4></div>
                        <div class="footer-info mb-35">
                            <div class="footer-info-item d-flex align-items-start pb-15 pt-15">
                                <div class="footer-info-icon mr-20"><span><i
                                        class="fa-solid fa-location-dot furniture-icon"></i></span></div>
                                <div class="footer-info-text"><a class="furniture-clr-hover" target="_blank"
                                                                 href="">北京市东城区藏经馆胡同17号1幢A103室</a></div>
                            </div>
                            <div class="footer-info-item d-flex align-items-start">
                                <div class="footer-info-icon mr-20"><span><i
                                        class="fa-solid fa-phone furniture-icon"></i></span></div>
                                <div class="footer-info-text"><a class="furniture-clr-hover" href="tel:012-345-6789">4001066666-5</a></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="container">
        <div class="footer-copyright-area b-t">
            <div class="footer-copyright-wrapper">
                <div class="footer-copyright-text"><p class="mb-0">© All Copyright 2024 by <a target="_blank"
                                                                                              class="furniture-clr-hover"
                                                                                              href="/url/index">Addina</a>
                </p></div>
                <div class="footer-payment d-flex align-items-center gap-2">
                    <div class="footer-payment-item mb-0">
                        <div class="footer-payment-thumb"><img src="../../imgs/icons/payoneer.png" alt=""></div>
                    </div>
                    <div class="footer-payment-item mb-0">
                        <div class="footer-payment-thumb"><img src="../../imgs/icons/maser.png" alt=""></div>
                    </div>
                    <div class="footer-payment-item">
                        <div class="footer-payment-thumb"><img src="../../imgs/icons/paypal.png" alt=""></div>
                    </div>
                </div>
                <div class="footer-conditions">
                    <ul>
                        <li><a class="furniture-clr-hover" href="#">经营许可</a></li>
                        <li><a class="furniture-clr-hover" href="#">隐私政策</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</footer>
<style>
    .cart-area .cart-plus, .cart-area .cart-minus {
        position: relative;
        width: 100%;
        height: 0;
        top: 0;
    }
</style>
<script src="../../js/jquery-3.6.0.min.js"></script>
<script src="../../js/waypoints.min.js"></script>
<script src="../../js/bootstrap.bundle.min.js"></script>
<script src="../../js/meanmenu.min.js"></script>
<script src="../../js/swiper.min.js"></script>
<script src="../../js/slick.min.js"></script>
<script src="../../js/magnific-popup.min.js"></script>
<script src="../../js/counterup.js"></script>
<script src="../../js/wow.js"></script>
<script src="../../js/ajax-form.js"></script>
<script src="../../js/beforeafter.jquery-1.0.0.min.js"></script>
<script src="../../js/main.js"></script>
<script src="../../js/vue.global.js"></script>
<script src="../../js/axios.min.js"></script>
</body>
<script>
    const app = {
        data() {
            return {
                user: {},
                orderList: [],
                showStatus: 1,
            }
        },
        methods: {
            updateInfo: function () {
                axios.post('/user/update',this.user)
                    .then((response) => {
                        alert('保存成功')
                    })
                    .catch((error) => {
                        console.error(error);
                        alert('保存失败')
                    })
            },
            listProduct: function () {
                location.href = '/url/prolist?keyword=' + this.keyword
            },
            changeShowStatus: function (showStatus) {
                this.showStatus = showStatus;
            }
        },
        created() {
            let _this = this
            let userid = '1'
            axios.get('/user/'+userid)
                .then((response) => {
                    _this.user = response.data.data
                })
                .catch((error) => {
                    console.error(error);
                    alert('初期化错误')
                })
            axios.get('/order/listuserorder/'+userid)
                .then((response) => {
                    _this.orderList = response.data.data
                })
                .catch((error) => {
                    console.error(error);
                    alert('初期化错误')
                })
        }
    }
    Vue.createApp(app).mount('body')
</script>
</html>